# https://docs.python.org/3/library/unittest.html
# https://docs.python.org/3/library/unittest.html#assert-methods
import unittest
from selenium import webdriver


class Test_Demo(unittest.TestCase):
    def setUp(self):
        """运行测试用例前执行"""
        self.driver = webdriver.Chrome()

    def test_open_baidu(self):
        """测试用例"""
        self.driver.get("https://www.baidu.com")
        # 断言
        self.assertIn('百度', self.driver.title)

    def tearDown(self):
        """测试后执行"""
        self.driver.quit()

    def test_open_bing(self):
        self.driver.get("https://www.bing.com")
        self.assertIn("Bing", self.driver.title)
